import requests

headers = {
    "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEzMTk3LCJpc3MiOiJjZ2Jvc3MiLCJleHAiOjE3NTA0MjczODUsIm5iZiI6MTc0NzgzNTM4NSwiaWF0IjoxNzQ3ODM1Mzg1fQ.Rlp3w6BOxpBRSE9IQvcnXxsWU0H2qkfmrUGjDBFFoXA"
}
session = requests.session()


class CgInstanceApis:

    @staticmethod
    def v1_instance_list(request_data):
        resp = session.post(url=f"https://cgboss.yuntiancloud.com/api/cginstance/v1/instance/list",
                            headers=headers, json=request_data)
        if resp.status_code == 200:
            return resp.json()

    @staticmethod
    def v1_vm_list(request_data):
        resp = session.post(url=f"https://cgboss.yuntiancloud.com/api/cginstance/v1/vm/list",
                            headers=headers, json=request_data)
        if resp.status_code == 200:
            return resp.json()